package splash.core.connection;

public class Response
{
	private PropertySet ps;
	private ResponseCode responseCode;
	
	public Response()
	{
		ps = new PropertySet();
		responseCode = ResponseCode.OK;
	}
	
	public void addProperty(Property p)
	{
		if(p == null)
			throw new NullPointerException("Null property.");
		ps.add(p);
	}

        public void addProperty(Property p, int pos)
	{
		if(p == null)
			throw new NullPointerException("Null property.");
		ps.add(pos, p);
	}
	
	public int count()
	{
		return ps.size();
	}
	
	public boolean remove(Property p)
	{
		return ps.remove(p);
	}
	
	public PropertySet getPropertySet()
	{
		//return this.ps;
		return (PropertySet)this.ps.clone();
	}
	
	public ResponseCode getResponseCode()
	{
		return this.responseCode;
	}
	
	public void setResponseCode(ResponseCode rc)
	{
		this.responseCode = rc;
	}
}